stylecontext: fix icon-source extents computation
authorBenjamin Otte <otte@redhat.com>
Tue, 21 Oct 2014 03:47:15 +0000 (05:47 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 21 Oct 2014 03:53:19 +0000 (05:53 +0200)
for the builtin image or invalid matrix case. We used to return invalid
memory in those cases. And that was not good.

gtk/gtkstylecontext.c

index 4cb834819e0e54418a02e3166c911b1c659658d1..dff7a6eb2b91b9b3abe4100c4f2c6b59a50dfc3a 100644 (file)
@@ -3548,10 +3548,10 @@ _gtk_style_context_get_icon_extents (GtkStyleContext *context,
   g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
   g_return_if_fail (extents != NULL);
 
-  rect.x = x;
-  rect.y = y;
-  rect.width = width;
-  rect.height = height;
+  extents->x = x;
+  extents->y = y;
+  extents->width = width;
+  extents->height = height;
 
   /* strictly speaking we should return an empty rect here,
    * but most code still draws a fallback  in this case */